import * as React from "react";
import { Admin ,Resource, EditGuesser,} from 'react-admin';
import polyglotI18nProvider from 'ra-i18n-polyglot';
import { UserList } from './users';
import {PostList, PostEdit, PostCreate} from "./posts"
//图标
import PostIcon from '@material-ui/icons/Book';
import UserIcon from '@material-ui/icons/Group';
import Dashboard from './Dashboard';
import authProvider from './authProvider';
import dataProvider from "./dataProvider";
import chinese from './i18n/zh';

const i18nProvider = polyglotI18nProvider(() => chinese);

const App = () => (
     <Admin dashboard = {Dashboard} dataProvider={dataProvider} authProvider={authProvider} i18nProvider = {i18nProvider}>
        <Resource name="posts" list={PostList} edit = {PostEdit} create = {PostCreate} icon={PostIcon} />
        <Resource name="users" list={UserList} icon = {UserIcon} />
        {/* <Resource name="books" list={UserList} icon = {UserIcon} /> */}
     </Admin>
);

export default App;

